package com.jetlion.servicebind2.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

import androidx.annotation.Nullable;

import com.jetlion.servicebind2.IStu;


public class AIDLService extends Service {

    private String stuNO = "201701";

    private String stuName= "Tom";

    //调用编译后的aidl接口，将方法重写
    private IStu.Stub mBinder = new IStu.Stub() {

        @Override
        public String getStuNo() throws RemoteException {
            return stuNO;
        }

        @Override
        public String getStuName() throws RemoteException {
            return stuName;
        }
    };


    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return mBinder;
    }

    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}
